#!	/bin/csh -f

# dcount:	a simple daemon counter.

set FILE = /tmp/dcount.$$

if ( $#argv != 1 ) then
	echo "dcount: usage: dcount daemonlistfile"
	exit
endif

/bin/ps ax | /usr/bin/fgrep -f $argv[1] | /usr/bin/egrep -v 'doc.csh|syswatch' > ${FILE} 
foreach daemon ( `cat $argv[1]` )
    echo -n "$daemon	"
    /usr/ucb/grep -c $daemon ${FILE}
end

rm -f ${FILE}
